<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:c="http://java.sun.com/jsp/jstl/core">
<p:outputPanel id="panel_goods" layout="block" rendered="#{not empty goodsBean.lazyModel}">

	<p:dataTable id="goodsTable" var="goods" value="#{goodsBean.lazyModel}" rows="20" paginator="true" lazy="true" style="margin-bottom:0"
	paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="10,20,50"
	selectionMode="single" selection="#{goodsForm.selectedGoods}">

		<p:column selectionMode="multiple" style = "width:16px;text-align:center" />

	    <p:column headerText="id" sortBy="id" style="width:30px;text-align:center">
	        <h:outputText value="#{goods.id}" />
	    </p:column>

	    <p:column headerText="goodsCode" style="width:100px;">
	        <h:outputText value="#{goods.goodsCode}" />
	    </p:column>

	    <p:column headerText="barcode" style="width:100px;">
	        <h:outputText value="#{goods.barcode}" />
	    </p:column>

	    <p:column headerText="name" sortBy="name">
	        <h:outputText value="#{goods.name}" />
	    </p:column>

	    <p:column headerText="taobaoName" sortBy="taobao_name">
	        <h:outputText value="#{goods.taobaoName}" />
	    </p:column>

	    <p:column headerText="goodsTypeId" sortBy="goods_typeId" style="width:50px;">
	        <h:outputText value="#{goods.goodsTypeId}" />
	    </p:column>

	    <p:column headerText="capacity" sortBy="capacity" style="width:50px;">
	        <h:outputText value="#{goods.capacity}" />
	    </p:column>

	    <p:column headerText="重量(g)" sortBy="weight" style="width:50px;">
	        <h:outputText value="#{goods.weight}" />
	    </p:column>

	    <p:column headerText="进价" sortBy="wholesale_price" style="width:50px;">
	        <h:outputText value="#{goods.wholesalePrice}" />
	    </p:column>

	    <p:column headerText="原价" sortBy="price" style="width:50px;">
	        <h:outputText value="#{goods.price}" />
	    </p:column>

	    <p:column headerText="售价" sortBy="sales_price" style="width:50px;">
	        <h:outputText value="#{goods.salesPrice}" />
	    </p:column>

	    <p:column headerText="delFlg" sortBy="del_flg" style="width:35px;">
	        <h:outputText value="#{goods.delFlg}" />
	    </p:column>

	    <p:column headerText="rgtOpt" sortBy="rgt_opt" style="width:80px;">
	        <h:outputText value="#{goods.rgtOpt}" />
	    </p:column>

	    <p:column headerText="updOpt " sortBy="upd_opt" style="width:80px;">
	        <h:outputText value="#{goods.updOpt}" />
	    </p:column>

	    <p:column headerText="rgtDate" sortBy="rgt_date" style="width:150px;">
	        <h:outputText value="#{goods.rgtDate}" />
	    </p:column>

	    <p:column headerText="updDate " sortBy="upd_date" style="width:150px;">
	        <h:outputText value="#{goods.updDate}" />
	    </p:column>

	    <p:column style="width:32px;text-align: center">
	        <p:commandButton title="更新" icon="ui-icon-search" id="btn_goods_update" actionListener="#{goodsBean.viewUpdateGoods(goods)}" ajax="true">
				<p:ajax event="dialogReturn" listener="#{goodsBean.updateGoodsResult}" update="goodsTable" />
			</p:commandButton>
	    </p:column>

	</p:dataTable>
</p:outputPanel>
</ui:composition>